package com.fank.current.queue.block;

import java.util.concurrent.BlockingQueue;
/**
 * producor每10秒在队列中放一个元素
 * @author Fanxk
 * @Date 2018年10月3日
 * @Version 1.0
 */
public class Producer implements Runnable
{
	protected BlockingQueue queue = null;

	public Producer(BlockingQueue queue)
	{
		this.queue = queue;
	}

	@Override
	public void run()
	{
		try
		{
			queue.put("1");
			Thread.sleep(1000);
			queue.put("2");
			Thread.sleep(1000);
			queue.put("3");
		} catch (InterruptedException e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}
	
	
}
